//
//  QZAddressCell.m
//  WeiWeiHaircut
//
//  Created by 超群 on 15/10/16.
//  Copyright © 2015年 超群. All rights reserved.
//

#import "QZAddressCell.h"

#import "QZAddressModel.h"
@interface QZAddressCell()
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *phoneNumber;
@property (weak, nonatomic) IBOutlet UILabel *address;


@end
@implementation QZAddressCell

- (void)awakeFromNib {
    // Initialization code
    _changeAddressVImageView.userInteractionEnabled = YES;
    [self setSelectionStyle:UITableViewCellSelectionStyleNone];

}
- (IBAction)defuClick:(id)sender {
    if (self.blick) {
        _blick(sender);
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setAddressModel:(QZAddressModel *)addressModel{
    
    _addressModel = addressModel;
    
    _name.text = addressModel.receiver;
    
    _phoneNumber.text = addressModel.tel;
    
    _address.text = [NSString stringWithFormat:@"%@ %@",addressModel.addressbie,addressModel.address];
    
    if (!addressModel.isDefault) {
        _DefulterButton.selected = YES;
        _DefulterButton.userInteractionEnabled = NO;
        [_DefulterButton setTitleColor:purColor2 forState:UIControlStateNormal];
        
    }else{
        _DefulterButton.selected = NO;
        _DefulterButton.userInteractionEnabled = YES;
        [_DefulterButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    }
    
}

@end
